//
//	ZcoModelScenario.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelScenario.h"

NSString *const kZcoModelScenarioAiBizflow = @"aiBizflow";
NSString *const kZcoModelScenarioCreatedAt = @"createdAt";
NSString *const kZcoModelScenarioCreatedBy = @"createdBy";
NSString *const kZcoModelScenarioHumanBizflow = @"humanBizflow";
NSString *const kZcoModelScenarioIdField = @"id";
NSString *const kZcoModelScenarioName = @"name";
NSString *const kZcoModelScenarioOrg = @"org";
NSString *const kZcoModelScenarioSchedPolicy = @"schedPolicy";
NSString *const kZcoModelScenarioStatus = @"status";
NSString *const kZcoModelScenarioUpdatedAt = @"updatedAt";

@interface ZcoModelScenario ()
@end
@implementation ZcoModelScenario




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelScenarioAiBizflow] isKindOfClass:[NSNull class]]){
		self.aiBizflow = [dictionary[kZcoModelScenarioAiBizflow] integerValue];
	}

	if(![dictionary[kZcoModelScenarioCreatedAt] isKindOfClass:[NSNull class]]){
		self.createdAt = dictionary[kZcoModelScenarioCreatedAt];
	}	
	if(![dictionary[kZcoModelScenarioCreatedBy] isKindOfClass:[NSNull class]]){
		self.createdBy = [dictionary[kZcoModelScenarioCreatedBy] integerValue];
	}

	if(![dictionary[kZcoModelScenarioHumanBizflow] isKindOfClass:[NSNull class]]){
		self.humanBizflow = [dictionary[kZcoModelScenarioHumanBizflow] integerValue];
	}

	if(![dictionary[kZcoModelScenarioIdField] isKindOfClass:[NSNull class]]){
		self.idField = [dictionary[kZcoModelScenarioIdField] integerValue];
	}

	if(![dictionary[kZcoModelScenarioName] isKindOfClass:[NSNull class]]){
		self.name = dictionary[kZcoModelScenarioName];
	}	
	if(![dictionary[kZcoModelScenarioOrg] isKindOfClass:[NSNull class]]){
		self.org = dictionary[kZcoModelScenarioOrg];
	}	
	if(![dictionary[kZcoModelScenarioSchedPolicy] isKindOfClass:[NSNull class]]){
		self.schedPolicy = [[ZcoModelSchedPolicy alloc] initWithDictionary:dictionary[kZcoModelScenarioSchedPolicy]];
	}

	if(![dictionary[kZcoModelScenarioStatus] isKindOfClass:[NSNull class]]){
		self.status = [dictionary[kZcoModelScenarioStatus] boolValue];
	}

	if(![dictionary[kZcoModelScenarioUpdatedAt] isKindOfClass:[NSNull class]]){
		self.updatedAt = dictionary[kZcoModelScenarioUpdatedAt];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	dictionary[kZcoModelScenarioAiBizflow] = @(self.aiBizflow);
	if(self.createdAt != nil){
		dictionary[kZcoModelScenarioCreatedAt] = self.createdAt;
	}
	dictionary[kZcoModelScenarioCreatedBy] = @(self.createdBy);
	dictionary[kZcoModelScenarioHumanBizflow] = @(self.humanBizflow);
	dictionary[kZcoModelScenarioIdField] = @(self.idField);
	if(self.name != nil){
		dictionary[kZcoModelScenarioName] = self.name;
	}
	if(self.org != nil){
		dictionary[kZcoModelScenarioOrg] = self.org;
	}
	if(self.schedPolicy != nil){
		dictionary[kZcoModelScenarioSchedPolicy] = [self.schedPolicy toDictionary];
	}
	dictionary[kZcoModelScenarioStatus] = @(self.status);
	if(self.updatedAt != nil){
		dictionary[kZcoModelScenarioUpdatedAt] = self.updatedAt;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:@(self.aiBizflow) forKey:kZcoModelScenarioAiBizflow];	if(self.createdAt != nil){
		[aCoder encodeObject:self.createdAt forKey:kZcoModelScenarioCreatedAt];
	}
	[aCoder encodeObject:@(self.createdBy) forKey:kZcoModelScenarioCreatedBy];	[aCoder encodeObject:@(self.humanBizflow) forKey:kZcoModelScenarioHumanBizflow];	[aCoder encodeObject:@(self.idField) forKey:kZcoModelScenarioIdField];	if(self.name != nil){
		[aCoder encodeObject:self.name forKey:kZcoModelScenarioName];
	}
	if(self.org != nil){
		[aCoder encodeObject:self.org forKey:kZcoModelScenarioOrg];
	}
	if(self.schedPolicy != nil){
		[aCoder encodeObject:self.schedPolicy forKey:kZcoModelScenarioSchedPolicy];
	}
	[aCoder encodeObject:@(self.status) forKey:kZcoModelScenarioStatus];	if(self.updatedAt != nil){
		[aCoder encodeObject:self.updatedAt forKey:kZcoModelScenarioUpdatedAt];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.aiBizflow = [[aDecoder decodeObjectForKey:kZcoModelScenarioAiBizflow] integerValue];
	self.createdAt = [aDecoder decodeObjectForKey:kZcoModelScenarioCreatedAt];
	self.createdBy = [[aDecoder decodeObjectForKey:kZcoModelScenarioCreatedBy] integerValue];
	self.humanBizflow = [[aDecoder decodeObjectForKey:kZcoModelScenarioHumanBizflow] integerValue];
	self.idField = [[aDecoder decodeObjectForKey:kZcoModelScenarioIdField] integerValue];
	self.name = [aDecoder decodeObjectForKey:kZcoModelScenarioName];
	self.org = [aDecoder decodeObjectForKey:kZcoModelScenarioOrg];
	self.schedPolicy = [aDecoder decodeObjectForKey:kZcoModelScenarioSchedPolicy];
	self.status = [[aDecoder decodeObjectForKey:kZcoModelScenarioStatus] boolValue];
	self.updatedAt = [aDecoder decodeObjectForKey:kZcoModelScenarioUpdatedAt];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelScenario *copy = [ZcoModelScenario new];

	copy.aiBizflow = self.aiBizflow;
	copy.createdAt = [self.createdAt copy];
	copy.createdBy = self.createdBy;
	copy.humanBizflow = self.humanBizflow;
	copy.idField = self.idField;
	copy.name = [self.name copy];
	copy.org = [self.org copy];
	copy.schedPolicy = [self.schedPolicy copy];
	copy.status = self.status;
	copy.updatedAt = [self.updatedAt copy];

	return copy;
}
@end
